package com.springboot.security.po;

import com.springboot.security.config.CacheFactory;
import com.springboot.security.entity.Customer;
import com.springboot.security.entity.DistributionMember;
import com.springboot.security.entity.Member;
import org.springframework.stereotype.Component;

/**
 * 认证具体操作
 */
@Component
public class AuthenticationOpt extends Authentication{




    @Override
    public void logout(Customer customer) {
        // 判断用户身份


        // 注销用户
        CacheFactory.getCache().invalidate("currentCustomer".concat(customer.getId()));
    }

    @Override
    public void logout(Member member) {
        CacheFactory.getCache().invalidate("currentMember".concat(member.getId()));
    }

    @Override
    public void logout(DistributionMember distributionMember) {
        CacheFactory.getCache().invalidate("currentDistribution".concat(distributionMember.getId()));
    }
}
